import axios from '@/api/fetch';
import * as types from './types';
import SERVER from '@/api/server';

// 备件报价单选择表单信息
export const SearchSalesQuote = params => axios.get(`${SERVER.DMSCLOUD_PART}/basedata/ttSalesQuote/SearchSalesQuote`, { params });
// 明细
export const querySalesQutationDetail = params => axios.get(`${SERVER.DMSCLOUD_PART}/basedata/ttSalesQuote/querySalesQutationDetail/${params}`, {});

// 客户名称表单信息
export const findPartCustomer = params => axios.get(`${SERVER.DMSCLOUD_PART}/basedata/ttSalesQuote/findPartCustomer`, { params });
// 客户类别下拉框
export const customersdict = params => axios.get(`${SERVER.DMSCLOUD_PART}/basedata/ttSalesQuote/customersdict`, {});

// 车主表单信息
export const owner = params => axios.get(`${SERVER.DMSCLOUD_PART}/basedata/ttSalesQuote/owner`, { params });

// 保存/save
export const handleSave = params => axios.post(`${SERVER.DMSCLOUD_PART}/basedata/ttSalesQuote/save`, params);
// 作废 /delete
export const handleDelete = params => axios.post(`${SERVER.DMSCLOUD_PART}/basedata/ttSalesQuote/delete`, params);
// 完成接口
export const finished = params => axios.post(`${SERVER.DMSCLOUD_PART}/basedata/ttSalesQuote/finished`, params);
// 导出
export const partSalesQteExport = SALES_QUOTE_NO =>
  axios.get(`${SERVER.DMSCLOUD_PART}/basedata/ttSalesQuote/excel/${SALES_QUOTE_NO}`, {
    responseType: 'arraybuffer'
  });
